<div xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:rich="http://richfaces.org/rich"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  class="mainNoTabs">

  <h:form>

  <nxu:dataTable id="dataTable" value="#{userSubscriptions}" var="row"
      rowClasses="dataRowEven,dataRowOdd" styleClass="dataOutput">

      <c:set var="doc" value="#{userNotificationActions.getDocument(row.docId)}"/>

      <!--  Notification -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.notification']}"/>
        </f:facet>
        <h:outputText styleClass="label" value="#{messages[notificationManager.getNotificationByName(row.notification).getLabel()]}"/>
      </nxu:column>

      <!--  Principal -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.subscribed.to']}"/>
        </f:facet>
        <h:outputText value="#{row.userId}"/>
      </nxu:column>

      <!--  Document -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.on.document']}"/>
        </f:facet>
        <h:outputText value="#{messages['label.deleted.document']} #{row.docId}" rendered="#{doc == null}"/>
        <nxd:restDocumentLink title="#{nxd:titleOrId(doc)}" document="#{doc}" rendered="#{doc != null}"
          tabs="MAIN_TABS:documents" addTabInfo="false">
          <span id="title_#{row.docId}">
          <h:outputText value="#{nxd:titleOrId(doc)}" />
          </span>
        </nxd:restDocumentLink>
        <div class="detail">
          <h:outputText value="#{doc.getPathAsString()}" rendered="#{doc != null}"/>
        </div>
      </nxu:column>

      <!--  Document -->
      <nxu:column>
        <f:facet name="controls">
          <h:outputText value="#{messages['label.on.document']}"/>
        </f:facet>
        <h:commandButton rendered="#{userNotificationActions.getCanRemoveNotification(row.userId)}"
          value="${messages['action.user.unsubscribe']}"
          styleClass="button"
          action="${notificationManager.removeSubscription(row.userId, row.notification, row.docId)}" />
      </nxu:column>
  </nxu:dataTable>

  </h:form>

</div>
